import navConfig, { NavItem } from "@/config/navConfig";
import styles from '@/components/navBar.module.css'
import { W1080Center } from "@/components/ui/W1080Center";
import { useRouter } from "next/navigation";
export interface InavBarProps {

}



export default function NavBar(props: InavBarProps) {
    const router = useRouter()
    const goPath = (item: NavItem) => {
        router.push(item.path)
    }
    return (
        <div className={styles.navBar}>
            <W1080Center className={styles.innerNavBar}>
                {navConfig.map((item: NavItem) => {
                    return <div onClick={goPath.bind(null, item)} className={styles.item} key={item.path}>
                        {item.desc}
                    </div>
                })}
            </W1080Center>

        </div>
    );
}
